﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="AnyOffice.general.system.url.index" %>
<%@ Reference Page="~/general/index.aspx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>公共网址管理</title>
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		
		<script src="/aspnet_client/core/function.js"></script>
		<script Language="JavaScript">
function CheckForm()
{
	if(document.Form1.txtUrlNo.value == "")
  {
	alert("序号不能为空！");
	document.Form1.txtUrlNo.focus();
    return false;
  }
  
	if(!checkIsInteger(document.Form1.txtUrlNo.value))
  {
	alert("序号必须为整数！");
	document.Form1.txtUrlNo.focus();
    return false;
  }
   if(document.Form1.txtUrlDesc.value=="")
   { 
	 alert("说明不能为空！");
	 document.Form1.txtUrlDesc.focus();
     return (false);
   }
   if(document.Form1.txtUrl.value=="")
   { 
     alert("网址不能为空！");
     document.Form1.txtUrl.focus();
     return (false);
   }
}

function delete_url(URL_ID)
{
 msg='确认要删除该项网址么？';
 if(window.confirm(msg))
 {
  URL="url_delete.aspx?url_id=" + URL_ID;
  window.location=URL;
 }
}
		</script>
	</HEAD>
	<body class="bodycolor" topmargin="5">
		<form id="Form1" method="post" runat="server">
         <div class="main_div">	
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="tab_ti">
							添加公共网址
					</td>
				</tr>
			</table>
			<table border="0" cellspacing="0" width="500" class="tab_pub" cellpadding="0"
				align="center">
				<TBODY>
					<tr>
						<td nowrap class="ta_bg">序号：</td>
						<td nowrap class="ta_txt">
							<asp:TextBox id="txtUrlNo" runat="server" CssClass="BigInput" Columns="6" MaxLength="4"></asp:TextBox>
						</td>
					<tr>
						<td nowrap class="ta_bg">说明：</td>
						<td nowrap class="ta_txt">
							<asp:TextBox id="txtUrlDesc" runat="server" CssClass="BigInput" Columns="25" MaxLength="200"></asp:TextBox>
						</td>
					</tr>
					<tr>
						<td nowrap class="ta_bg">网址：</td>
						<td nowrap class="ta_txt">
							<asp:TextBox id="txtUrl" runat="server" CssClass="BigInput" Columns="25" MaxLength="200">http://</asp:TextBox>
						</td>
					</tr>
					<tr>
						<td nowrap class="bnt_con" colspan="2" align="center">
							<input type="submit" onClick="return CheckForm();" value="添 加" class="BigButton" title="添加网址"
								name="button">
						</td>
					</tr>
				</TBODY>
			</table>
			<br>
			<table width="95%" border="0" cellspacing="0" cellpadding="0" height="3">
				<tr>
					<td background="/images/dian1.gif" width="100%"></td>
				</tr>
			</table>
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="tab_ti">
							管理公共网址
					</td>
				</tr>
			</table>			
			<asp:Repeater id="rptUrl" runat="server" EnableViewState="False">			
				<HeaderTemplate>
				<br>
					<table border="0" cellspacing="0" width="500" class="tab_pub" cellpadding="0"
						align="center">
						<TR>
							<td nowrap class="TableHeader" align="center">序号</td>
							<td nowrap class="TableHeader" align="center">说明</td>
							<td nowrap class="TableHeader" align="center">网址</td>
							<td nowrap class="TableHeader" align="center">操作</td>
						</TR>
				</HeaderTemplate>
				<ItemTemplate>
					<tr class="TableLine1">
						<td nowrap align="center"><%#Eval("UrlNo")%></td>
						<td><%#Eval("UrlDesc")%></td>
						<td nowrap><A href="<%#Eval("Url")%>" target="_blank"><%#Eval("Url")%></A></td>
						<td nowrap align="center" width="80">
							<a href="url_edit.aspx?url_id=<%#Eval("UrlId")%>">编辑</a> <a href="javascript:delete_url('<%#Eval("UrlId")%>');">删除</a>
						</td>
					</tr>
				</ItemTemplate>
				<AlternatingItemTemplate>
				<tr class="TableLine2">
						<td nowrap align="center"><%#Eval("UrlNo")%></td>
						<td><%#Eval("UrlDesc")%></td>
						<td nowrap><A href="<%#Eval("Url")%>" target="_blank"><%#Eval("Url")%></A></td>
						<td nowrap align="center" width="80">
							<a href="url_edit.aspx?url_id=<%#Eval("UrlId")%>">编辑</a> <a href="javascript:delete_url('<%#Eval("UrlId")%>');">删除</a>
						</td>
					</tr>
				</AlternatingItemTemplate>
				<FooterTemplate>
					</table>
				</FooterTemplate>
			</asp:Repeater>			
			<asp:Literal id="litMessage" runat="server" EnableViewState="False"></asp:Literal>
            </div>
		</form>
	</body>
</HTML>
